<!DOCTYPE html>  
<!-- HTML5 document type -->
<html>
<head>
	<script type="text/javascript" src="go.js"></script>
	<script type="text/javascript" src="easyui/jquery.min.js"></script>
	
</head>
<body>
	<div id="sample" style="width:400px; height:400px; border:1px solid red;"></div>
</body>
<script type="text/javascript">
/* 	(function($) {
		var sample = $(go.Diagram, "sample", {
			initialContentAlignment: go.Spot.Center, // center Diagram contents
			"undoManager.isEnabled": true // enable Ctrl-Z to undo and Ctrl-Y to redo
		});
		var myModel = $(go.GraphLinksModel); //$(go.Model);
		// in the model data, each node is represented by a JavaScript object:
		myModel.nodeDataArray = [
		  { key: "Alpha", name:"a1" },
		  { key: "Beta" , name:"a2"},
		  { key: "Gamma" , name:"a3"},
		  {key:""}
		];
		myModel.linkDataArray =
		[
		  { from: "Alpha", to: "Beta" },
		  { from: "Beta", to: "Gamma" }
		];
		sample.nodeTemplate =$(go.Node,
			{ background: "#44CCFF" },
			 $(go.TextBlock, "Default Text",
			  { margin: 12, stroke: "white", font: "bold 16px sans-serif" },
			  new go.Binding("text", "name"))
		 );
		 
		 sample.linkTemplate =
		  $(go.Link,
			{ routing: go.Link.Orthogonal, corner: 5 },
			$(go.Shape, { strokeWidth: 3, stroke: "#555" })); // the link shape

		 
		 sample.layout =
		  $(go.TreeLayout,
			{ angle: 90, layerSpacing: 35 });
		sample.model = myModel;
	})(go.GraphObject.make); */
	var datas={"nodeDataArray":[{"className":"testClassName"}],"linkFromPortIdProperty":"linkFromPortIdProperty"};
	var params=JSON.stringify(datas);
	$.ajax({
		   type: "POST",
		   url: "draw/generateCode.do",
		   dataType:"json",
		   data: "graph="+params,
		   success: function(msg){
		     alert( "Data Saved: " + msg );
		   }
		});
	
	</script>
</html>